import { createApp } from 'vue'
import { RouterView } from 'vue-router'
import router from './router'
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import 'normalize.css/normalize.css'
import 'element-plus/dist/index.css'
import '@/styles/global.scss'

import ElementCrudTable from 'el-crud-table'
import 'el-crud-table/dist/style.css'

import request from '@/utils/request'

import {
  StaticSelector,
  DynamicSelector,
  DynamicCascader,
  FileUploader,
  DynamicCheckbox
} from '@/components/Form'

const app = createApp(RouterView) //renderer.ts 2339

app
  .use(ElementPlus, { locale: zhCn })
  .use(router)
  .use(ElementCrudTable, {
    requestMethod: request,
    requestKeys: { dataKey: 'results' }
  })

app.component('StaticSelector', StaticSelector)
app.component('DynamicSelector', DynamicSelector)
app.component('DynamicCascader', DynamicCascader)
app.component('FileUploader', FileUploader)
app.component('DynamicCheckbox', DynamicCheckbox)

app.mount('#app')
